<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weui.css" />
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weuix.css" />
    <script src="/lobsteruiframe/weui/js/zepto.min.js"></script>
    <script src="/lobsteruiframe/weui/js/zepto.weui.js"></script>
    <script src="/lobsteruiframe/weui/js/swipe.js"></script>
    <script src="/lobsteruiframe/weui/js/macy.js"></script>
    <script src="js/handlebars.min.js"></script>
    <script src="/jslib/lobster.js"></script>
    <script src="js/config.js"></script>
    <style>
        * {
        padding:5px;
        }
        .cms-art-time {
        padding-top:10px;
        }
    </style>
</head>

<body>
    <div id="detail"></div>
</body>

</html>
<!--选项卡模板-->
<script type="text/template" id="detailTemplate">
    <div class="cms-block">
        <div class="cms-art-title" style="text-align:left;font-weight:bold;padding:10px 20px 10px 0;">{{Title}}</div>
        <div class="cms-art-author" style="padding:unset;text-align:left;font-size:12px;display:flex;padding-bottom:5px;">
            <span class="cms-art-time">{{ReleaseTime}}</span>
            <div style="display:flex;align-items:center;padding-left: 20px;">
                <img style="width:16px" src="images/eye.png" />
                <span>{{TotalHit}}</span>
            </div>
        </div>
        <div style="background-color:#f0f0f0;border-radius:5px;color:gray;padding:15px 10px 15px 10px;">
            <span>{{Intraduce}}</span>
        </div>
        <div class="cms-art">
            {{{U_Cont}}}
        </div>
    </div>
</script>

<script>
    var controller = {
        data: {
            workId:0,
            websiteid:0
        },
        //初始化页面
        initpage: function () {
            this.data.workId = lobsterh5.GetUrlParam("workId") || 2049;
            this.data.websiteid = lobsterh5.GetUrlParam("websiteId") || 1019;
            this.initevent();
            this.getContextData(); 
        },

        //初始化事件
        initevent: function () {
            var self = this;

        },
        getContextData: function () {
            lobsterh5.GETAPI("tsFrontShow.getcontextdata", {id: lobsterh5.GetUrlParam("id")}).then(res => {
                var tpl = $("#detailTemplate").html()
                var template = Handlebars.compile(tpl);
                var html = template(res.data);
                $("#detail").html(html);
                this.updatetotalhit(res.data.CID);
            })
        },
        updatetotalhit:function(cid){
            lobsterh5.GETAPI("tsFrontShow.updatetotalhit", {
                cid: cid
            }).then(res => {
                
            })
        }
    }

    $(function () {
        controller.initpage();
    })

</script>